﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace QLKS.Converters
{
    class GioiTinhConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string gioitinh = parameter.ToString();
            string v = value.ToString();
            return (gioitinh.ToUpper() == v.ToUpper()) ? true : false;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            bool v = (bool)value;
            string gt = parameter.ToString();
            if (v && gt.ToUpper() == "NAM")
                return "Nam";
            
            return "Nữ";
        }
    }
}
